#!/usr/bin/python3.4
# -*- coding=utf-8 -*-

import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *

def arpping(network_prefix):
    result_raw = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=network_prefix),timeout=2,iface ='eno33554944',verbose=False)
	result_list = result_raw[0].res
#	print(len(result_list))
	for i in range(len(result_list)):
		arp_result_fields = result_list[i][1][1].fields
		print('IP地址: ' + arp_result_fields['psrc'] + '   is UP!!!   ' + 'MAC地址为: ' + arp_result_fields['hwsrc'] )

if __name__ == '__main__':
	arpping('202.100.1.0/24')
    
==================================测试效果=================================
[root@Fedora python]# ./ARP_ping.py 
IP地址: 202.100.1.200   is UP!!!   MAC地址为: 00:0c:29:d3:51:eb